﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace ChainTest
{
    public class Chain
    {
        private bool Current;
        public Chain(bool current)
        {
            this.Current = current;
        }
        public Chain Next(Expression<Func<Chain,bool>> exp)
        {
            if (Current == true)
            {
                var fun = exp.Compile();
                Current = fun(this);
            }
            return this;
        }
    }
}
